<?php

/**
 * Created by PhpStorm.
 * User: Leen
 * Date: 2016/1/4
 * Time: 15:57
 */

namespace App\Http\Requests\Front\my;

use App\Http\Requests\Request;

class RefundGoodsApplyRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * 验证规则
     *
     * @return array
     */
    public function rules()
    {
        $rules =  [

            'after_sales_type' => 'required|between:1,1',
            'after_sales_number' => 'required|between:1,1',
            'reason' => 'required|max:255',
            'consignee' => 'required|max:255',
            'phone' => 'required|size:11',

        ];
        return $rules;

    }

    /**
     * 验证信息
     * @return array
     */

    public function messages()
    {
        return [
            'after_sales_type.required'  => '请选择售后类型',
            'after_sales_number.required'  => '售后数量不能为空',
            'reason.required'  => '原因不能为空',
            'consignee.required'  => '客户姓名不能为空',
            'phone.required'  => '手机号码不能卫东',

            'after_sales_type.between'  => '售后类型不正确',
            'after_sales_number.between'  => '售后数量正确',
            'reason.max'  => '原因最多255个字符',
            'consignee.max'  => '客户姓名最大255个字符',
            'phone.size'  => '手机号码必须11位',
        ];
    }
}